package com.example.experiment2;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class CatsListView extends AppCompatActivity {

    private String[] data = {"暹罗猫", "布偶猫", "折耳猫", "短毛猫", "波斯猫", "蓝猫", "森林猫", "孟买猫","缅因猫","埃及猫","伯曼猫","缅甸猫","新加坡猫","美国短尾猫","巴厘猫"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_list_view);

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(
                CatsListView.this, android.R.layout.simple_list_item_1, data);
        ((ListView) findViewById(R.id.list)).setAdapter(adapter);
    }
}
